import request from "@/utils/request";

// 获取自身填表台账数据列表 错误码
export function getLedgerlist(params) {
  return request({
    url: "/system/ledger/self/list",
    method: "get",
    params,
  });
}

// 新增能源消费台账 错误码
export function postLedger(data) {
  return request({
    url: "/system/ledger",
    method: "post",
    data,
  });
}

// 修改能源消费台账 错误码
export function putLedger(data) {
  return request({
    url: "/system/ledger",
    method: "put",
    data,
  });
}

// 详情
export function getLedgerDetail(id) {
  return request({
    url: `/system/ledger/${id}`,
    method: "get",
  });
}

// 综表详情
export function comprehensive(id) {
  return request({
    url: `/system/ledger/comprehensive/table/${id}`,
    method: "get",
  });
}

// 删除
export function deleteLedger(id) {
  return request({
    url: `/system/ledger/${id}`,
    method: "delete",
  });
}

// 判断是否新增
export function judgeLedgerAdd(params) {
  return request({
    url: `/system/ledger/add/judge`,
    method: "get",
    params,
  });
}

// 获取上月台账数据
export function getLedgerlastmonth(params) {
  return request({
    url: `/system/ledger/lastmonth/ledgerdata`,
    method: "get",
    params,
  });
}

// 获取去年台账数据
export function getLedgerlastyear(params) {
  return request({
    url: `/system/ledger/lastyear/ledgerdata`,
    method: "get",
    params,
  });
}

// 上报
export function reportLedger(params) {
  return request({
    url: `/system/ledger/report`,
    method: "get",
    params,
  });
}

// 汇总自身的数据
export function collectLedgerself(params) {
  return request({
    url: `/system/ledger/collect/self`,
    method: "get",
    params,
  });
}

// 驳回接口
export function rejectLedger(params) {
  return request({
    url: `/system/ledger/reject`,
    method: "get",
    params,
  });
}

// 纠正
export function correctLedger(params) {
  return request({
    url: `/system/ledger/correct`,
    method: "get",
    params,
  });
}

// 撤回
export function recallLedger(params) {
  return request({
    url: `/system/ledger/withdraw`,
    method: "get",
    params,
  });
}

// 获取下级部门填表台账数据列表
export function getLowLevellist(params) {
  return request({
    url: "/system/ledger/lowLevel/list",
    method: "get",
    params,
  });
}

// 审核通过
export function getLedgerpass(params) {
  return request({
    url: "/system/ledger/pass",
    method: "get",
    params,
  });
}

// 汇总数据列表
export function gettobesummarizedlist(params) {
  return request({
    url: "/system/ledger/tobesummarized/list",
    method: "get",
    params,
  });
}

// 汇总所有台账数据
export function collectLedgerAll(params) {
  return request({
    url: `/system/ledger/collect/all`,
    method: "get",
    params,
  });
}

// 确认退回
export function getLedgermodify(params) {
  return request({
    url: "/system/ledger/modify",
    method: "get",
    params,
  });
}

// 获取台账树形结构数据
export function getTree(params) {
  return request({
    url: "/system/ledger/summarizedledger/tree",
    method: "get",
    params,
  });
}

// 获取台账审核流水
export function getFlow(params) {
  return request({
    url: "/system/ledger/ledgerapproval/flow",
    method: "get",
    params,
  });
}

// 获取部门列表
export function listDept(params) {
  return request({
    url: "/system/ledger/dept/list",
    method: "get",
    params,
  });
}

// 获取退回原因
export function getBackreason(params) {
  return request({
    url: "/system/ledger/reject/msg",
    method: "get",
    params,
  });
}

// （重构）获取区域台账审核列表
export function getAreaAuditlist(params) {
  return request({
    url: "/system/ledger/region/list",
    method: "get",
    params,
  });
}

// (重构)获取区域待汇总数据列表
export function getAreaReportlist(params) {
  return request({
    url: "/system/ledger/tobesummarized/region/list",
    method: "get",
    params,
  });
}


// （重构）获取区域汇总台账部门下拉列表
export function getARdeptlist(params) {
  return request({
    url: "/system/ledger/region/dept",
    method: "get",
    params,
  });
}

// （重构）区域汇总台账数据
export function getARdeptsummary(params) {
  return request({
    url: "/system/ledger/region/summary",
    method: "get",
    params,
  });
}

// 查询能耗台账年度统计列表
export function getStandbookYearlist(params) {
  return request({
    url: "/system/year/list",
    method: "get",
    params,
  });
}

// 查询能耗台账年度统计详情
export function getStandbookYearDetail(id) {
  return request({
    url: `/system/year/${id}`,
    method: "get",
  });
}

// 获取月度能耗信息
export function energyconsumption(params) {
  return request({
    url: `/system/ledger/dept/energyconsumption`,
    method: "get",
    params,
  });
}

// 综表详情全年
export function comprehensiveAnnual(params) {
  return request({
    url: `/system/ledger/comprehensive/tables/annual`,
    method: "get",
    params
  });
}

// 综表详情全年一表
export function comprehensiveAnnualTable(params) {
  return request({
    url: `/system/ledger/comprehensive/table1/annual`,
    method: "get",
    params
  });
}
